import http from "@/utils/fetch";
import qs from 'qs';

/**
 * 订单管理
 */
// 订单列表
export function orderList(params) {
    return http.post("/Admin/Order/orderList", params);
}
// 订单列表
export function orderList2(params) {
    return http.post("/Admin/Order/orderList2", params);
}
// 征信订单列表
export function creditOrderList(params) {
    return http.post("/Admin/Order/creditOrderList", params);
}
// 手动风控
export function orderRisk(params) {
    return http.post("/Admin/Order/orderRisk", params, true);
}
// 查看租期
export function getLease(orderId) {
    return http.post("/Admin/Order/getLease", { orderId });
}
// 设置修改收货地址
export function setAddress(params) {
    return http.post("/Admin/Order/setAddress", params, true);
}
// 获取所有区域
export function getRegion() {
    return http.post("/Admin/Order/getRegion");
}
// 获取订单编辑数据
export function getOrderData() {
    return http.post("/Admin/Order/getOrderData");
}
// 编辑订单数据
export function editOrderData(params) {
    return http.post("/Admin/Order/editOrderData", params, true);
}
// 签署担保合同
export function createCreditCompany(orderId) {
    return http.post("/Admin/Order/createCreditCompany", { orderId }, true);
}
// 查看风控大数据
export function getRiskData(params) {
    return http.post("/Admin/Order/getRiskData", params, true);
}
// 查看新版征信
export function getCreditNewData(orderId) {
    return http.post("/Admin/Order/getCreditNewData", { orderId }, true);
}
// 查看还款风控大数据
export function getAbData(params) {
    return http.post("/Admin/Order/getAbData", params, true);
}
// 查看征信
export function getCreditData(params) {
    return http.post("/Admin/Order/getCreditData", params, true);
}
// 查看全景雷达报告
export function getRadarData(params) {
    return http.post("/Admin/Order/getRadarData", params, true);
}

// 查看蚂蚁风控
export function getAntData(params) {
    return http.post("/Admin/Order/getAntData", params, true);
}
// 上征信
export function setCreditData(params) {
    return http.post("/Admin/Order/setCreditData", params, true);
}
// 获取供应商数据
export function getShopUser(params) {
    return http.post("/Admin/Order/getShopUser");
}
// 添加设备编号
export function setDeviceNumber(params) {
    return http.post("/Admin/Order/setDeviceNumber", params, true);
}
// 添加客服备注
export function setOrderRemark(params) {
    return http.post("/Admin/Order/setOrderRemark", params, true);
}
// 删除客服备注
export function delRemark(params) {
    return http.post("/Admin/Order/delOrderRemark", params, true);
}
// 设置充值押金
export function orderRecharge(params) {
    return http.post("/Admin/Order/orderRecharge", params, true);
}
// 退充值押金
export function orderRechargeRefund(params) {
    return http.post("/Admin/Order/orderRechargeRefund", params, true);
}
// 获取客服备注记录
export function getOrderRemark(params) {
    return http.post("/Admin/Order/getOrderRemark", params);
}
// 查看流水记录
export function getLeaseFlow(orderNo) {
    return http.post("/Admin/Order/getLeaseFlow", { orderNo });
}
// 获取物流公司列表
export function getLogisticAll() {
    return http.post("/Admin/Order/getLogisticAll");
}
// 发货
export function deliverGoods(params) {
    return http.post("/Admin/Order/deliverGoods", params, true);
}
// 导出签收凭证word
export function downloadWord(params) {
    const baseURL = `${process.env.VUE_APP_BASE_API}`;
    const url = '/Download/Order/express';
    const paramsObj = { ...params, export: true };
    const paramsStr = `?${qs.stringify(paramsObj)}`;
    // console.log(baseURL + url + paramsStr);
    window.location.href = baseURL + url + paramsStr;
}
// 确认收货
export function confirmGoods(params) {
    return http.post("/Admin/Order/confirmGoods", params, true);
}
// 获取剩余押金
export function getSurplusDeposit(orderId) {
    return http.post("/Admin/Order/getSurplusDeposit", { orderId });
}
// 扣除押金
export function deductDeposit(params) {
    return http.post("/Admin/Order/deductDeposit", params, true);
}
// 获取账单详情
export function getLeaseInfo(orderId) {
    return http.post("/Admin/Order/getLeaseInfo", { orderId });
}
// 获取每期租金
export function getLeaseRent(orderId) {
    return http.post("/Admin/Order/getLeaseRent", { orderId });
}
// 获取物流信息
export function getLogisticInfo(params) {
    return http.post("/Admin/Order/getLogisticInfo", params);
}
// 补充发货确认收货凭证
export function setOrderVoucher(params) {
    return http.post("/Admin/Order/setOrderVoucher", params, true);
}
// 获取订单状态列表
export function getOrderStatus() {
    return http.post("/Admin/Order/getOrderStatus");
}
// 获取订单是否有备注
export function isOrderRemark() {
    return http.post("/Admin/Order/isOrderRemark");
}
// 订单列表导出
export function orderListExport(params) {
    return http.export("/Admin/Order/orderListExport", params, "订单列表");
}
// 花呗订单列表
export function orderHuaBeiList(params) {
    return http.post("/Admin/Order/orderHuaBeiList", params);
}
// 花呗订单列表-导出
export function orderHuaBeiExport(params) {
    return http.export("/Admin/Order/orderHuaBeiExport", params, "花呗订单列表");
}
// 买断订单列表
export function orderBuyOutList(params) {
    return http.post("/Admin/Order/orderBuyOutList", params);
}
// 买断订单列表-导出
export function orderBuyOutListExport(params) {
    return http.export(
        "/Admin/Order/orderBuyOutListExport",
        params,
        "买断订单列表"
    );
}
// 签约待付款订单列表
export function orderSignedList(params) {
    return http.post("/Admin/Order/orderSignedList", params);
}
// 签约待支付订单列表-导出
export function orderSignedListExport(params) {
    return http.export(
        "/Admin/Order/orderSignedListExport",
        params,
        "签约待支付订单列表"
    );
}
// 交易完成
export function orderFinish(orderId) {
    return http.post("/Admin/Order/orderFinish", { orderId }, true);
}
// 订单同意归还
export function orderReturnAgree(orderId) {
    return http.post("/Admin/Order/orderReturnAgree", { orderId }, true);
}
// 订单归还审核拒绝
export function orderReturnRefuse(params) {
    return http.post("/Admin/Order/orderReturnRefuse", params, true);
}
// 订单确认归还
export function orderComfirmReturn(orderId) {
    return http.post("/Admin/Order/orderComfirmReturn", { orderId }, true);
}
// 订单归还完成
export function orderReturnFinish(orderId) {
    return http.post("/Admin/Order/orderReturnFinish", { orderId }, true);
}
// 订单关闭
export function orderClose(orderId) {
    return http.post("/Admin/Order/orderClose", { orderId }, true);
}
// 订单审核拒绝
export function orderRefuse(orderId) {
    return http.post("/Admin/Order/orderRefuse", { orderId }, true);
}

// 续租订单列表
export function orderRenewalList(params) {
    return http.post("/Admin/Order/orderRenewalList", params)
}
// 修改订单物流信息
export function editOrderExpress(params) {
    return http.post("/Admin/Order/editOrderExpress", params, true)
}
// 风控列表
export function orderSuccessList(params) {
    return http.post("/Admin/Order/orderSuccessList", params);
}
// 风控列表
export function reFaceAuth(params) {
    return http.post("/Admin/Order/reFaceAuth", params);
}
// 设置押金
export function setMoney(params) {
    return http.post("/Admin/Data/setMoney", params);
}

export function getOrderDetail(orderId) {
    return http.post("Admin/Order/getOrderDetail", { orderId }, true);
}
export function OrderDetailExport(params) {
    return http.export("/Admin/Order/OrderDetailExport", params, "蚂蚁链数据列表");
}

export function setOrderSync(params) {
    return http.post("/Admin/Order/setOrderSync", params);
}

// 执行第一次征信请求
export function getFirstCreditNewData(params) {
    return http.post("/Admin/Order/getFirstCreditNewData", params);
}
// 上公证信息
export function setOrderLease(params) {
    return http.post("/Admin/Order/setOrderLease", params);
}

export function getOrderLeaseImg(orderId) {
    return http.get("/Admin/Order/getOrderLeaseImg", { orderId });
}
// 审批通过
export function passOrderApproval(orderId) {
    return http.get("/Admin/Order/passOrderApproval", { orderId });
}
// 审批驳回
export function rejectOrderApproval(params) {
    return http.get("/Admin/Order/rejectOrderApproval", params);
}
// 取消公证
export function cancelOrderApproval(params) {
    return http.get("/Admin/Order/cancelOrderApproval", params);
}
// 获取套餐
export function getGoodsAttr(goods_id) {
    return http.get("/Admin/Order/getGoodsAttr", { goods_id });
}
// 
// 设置套餐
export function setGoodsAttr(params) {
    return http.post("/Admin/Order/setGoodsAttr", params);
}
// 查询二要素
export function getNetwork(params) {
    return http.post("/Admin/Order/getNetwork", params);
}
// 获取二要素记录
export function getNetworkDetail(orderId) {
    return http.get("/Admin/Order/getNetworkDetail", { orderId });
}
// 再次获取风控建议信息
export function reGetRisk(orderId) {
    return http.post("/Admin/Order/reGetRisk", { orderId });
}
// 都来租租赁凭证
export function express_doulaizu(params) {
    // return http.get("/Download/Order/express_doulaizu", params);
    const baseURL = `${process.env.VUE_APP_BASE_API}`;
    const url = '/Download/Order/express_doulaizu';
    const paramsObj = { ...params, export: true };
    const paramsStr = `?${qs.stringify(paramsObj)}`;
    // console.log(baseURL + url + paramsStr);
    window.location.href = baseURL + url + paramsStr;
}
// 
export function getFraudData(orderId) {
    return http.get("/Admin/Order/getFraudData", { orderId });
}
// 查看学历报告
export function getEduData(params) {
    return http.post("/Admin/Order/getEduData", params, true);
}
// 获取探针C+全景雷达
export function getBehaviorData(params) {
    return http.post("/Admin/Order/getBehaviorData", params, true);
}
// 蚂蚁风险5类查询
export function getAntRiskData(params) {
    return http.post("/Admin/Order/getAntRiskData", params, true);
}
// 三种要素查询
export function getOperatorData(params) {
    return http.post("/Admin/Order/getOperatorData", params, true);
}
// 运行商基础信息
export function getMobileData(params) {
    return http.post("/Admin/Order/getMobileData", params, true);
}
// 查看租期-分账
export function setRelationPrice(params) {
    return http.post("/Admin/Order/setRelationPrice", params);
}
// 天狼星风控大数据
export function getNewRiskData(params) {
    return http.post("/Admin/Order/getNewRiskData", params);
}
// 修改商品信息
export function editOrderGoodsData(params) {
    return http.post("Admin/Order/editOrderGoodsData", params);
}
// 审核专用
export function getSQCreditData(params) {
    return http.post("Admin/Order/getSQCreditData", params);
}

// 订单-征信客户
export function getFirstCreditData(params) {
    return http.post("Admin/Order/getFirstCreditNewData2", params);
}
export function getCreditData2(params) {
    return http.post("Admin/Order/getCreditNewData2", params);
}
export function getCreditNewList(params) {
    return http.post("Admin/Order/getCreditNewList", params);
}
